<?php
/** ************************
	Php Quran - 2009
Copyrights for all muslims
***************************/

	// security .. 
	define ( 'IN_INDEX' , true);
	//include imprtant file .. 
	include ('includes/common.php');
	//start xml
	header('Content-Type: text/xml');
	echo "<?xml version='1.0' encoding='UTF-8'?>";
	
	$reciter_id = isset($_GET['rid']) ? $SQL->escape($_GET['rid']) : '';
	$query = array('SELECT' => '*',
				   'FROM'	=> "{$dbprefix}telawat",
								);
	if(!empty($reciter_id))
	{
		$query['WHERE'] = 'reciter_id = \'' . $reciter_id . '\'';
	}
	
	$row = $SQL->build($query);
?>
<songs>
<?php
while($result = $SQL->fetch_array($row))
{
	$result['telawa_title'] = @iconv('UTF-8', 'UTF-8//IGNORE', $result['telawa_title']);
?>
<song path="<?php echo $result['telawa_path']; ?>" title="<?php echo $result['telawa_title']; ?>" />
<?php
}

$SQL->freeresult($result);
$SQL->close();
?>
</songs>
<?php
exit;
?>